package csd.wyaiyr.com.config;


import csd.wyaiyr.com.mapper.SysUserMapper;
import csd.wyaiyr.com.model.SysUser;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Configuration;

import java.util.List;

// 项目启动即查询

@Configuration
@Slf4j
public class LoadDataBase implements CommandLineRunner{

    @Autowired
    private SysUserMapper sysUserMapper;

    @Override
    public void run(String... args) throws Exception {
        List<SysUser> list = sysUserMapper.selectAll();
        log.info("初始化查询>>>当前用户数：{}个",list.size());
    }
}
